﻿using Sys.Core.Tour;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class RouteList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!IsPostBack)
            {
                Home mas = Master as Home;

                mas.SetHead("旅游线路", "旅游线路", "旅游线路");
            }
        }
    }

    public string GetRouteList()
    {
        System.Text.StringBuilder sb = new System.Text.StringBuilder();

        var list = RouteBll.I.Entities.OrderByDescending(m => m.Top).ThenByDescending(m => m.UpdateTime).ToList();

        for (int i = 0; i < list.Count; i++)
        {
            string cls = string.Empty;

            if (i % 2 == 0)
            {
                cls = " class='td'";
            }

            sb.Append("<tr>");
            sb.Append("<td" + cls + "><a href='Route.aspx?id=" + list[i].ID + "' target='_blank'>" + list[i].Name + "</a></td>");
            sb.Append("<td" + cls + "><strong>" + list[i].Price + "</strong>/人起</td>");
            sb.Append("</tr>");
        }

        return sb.ToString();
    }
}